https://glot.io/snippets/ghwf0jvjiw/raw/main.lua